package com.example.weatherpiano.DAO;

import com.example.weatherpiano.R;

import java.util.Date;

public class RecWeather {
    private Integer rid;
    private Integer city_id;
    private String date;
    private String  weather;
    private Integer max_temp;
    private Integer min_temp;

    public RecWeather(Integer rid, Integer city_id, String date, String weather, Integer max_temp, Integer min_temp) {
        this.rid = rid;
        this.city_id = city_id;
        this.date = date;
        this.weather = weather;
        this.max_temp = max_temp;
        this.min_temp = min_temp;
    }

    public Integer getRid() {
        return rid;
    }

    public void setRid(Integer rid) {
        this.rid = rid;
    }

    public Integer getCity_id() {
        return city_id;
    }

    public void setCity_id(Integer city_id) {
        this.city_id = city_id;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getWeather() {
        return weather;
    }

    public void setWeather(String weather) {
        this.weather = weather;
    }

    public Integer getMax_temp() {
        return max_temp;
    }

    public void setMax_temp(Integer max_temp) {
        this.max_temp = max_temp;
    }

    public Integer getMin_temp() {
        return min_temp;
    }

    public void setMin_temp(Integer min_temp) {
        this.min_temp = min_temp;
    }

    public Integer getIconId() {
        switch (weather) {
            case "晴朗" :
                return R.drawable.sun;
            case "小雨" :
                return R.drawable.rain;
            case "多云" :
                return R.drawable.cloudy;
            default:
                return 0;
        }

    }
    public String getCurrent_temp() {
        return max_temp + " - " + min_temp + "℃";
    }
}
